<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //定时器，settimeout setinterval
       setTimeout(fun,2000);//一次定时器
       function fun(){
            alert("天天向上")
       }
       setInterval(fun,2000);//循环定时器
</script>
</body>
</html>